package com.socialuni.center.web.serive.api;

import com.socialuni.sdk.api.model.QO.talk.*;
import com.socialuni.sdk.api.model.RO.talk.SocialTalkRO;
import com.socialuni.sdk.api.model.ResultRO;
import com.socialuni.center.web.serive.talk.*;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author qinkaiyuan
 * @date 2020-05-16 20:11
 */
@Service
public class CenterTalkService {
    @Resource
    CenterQueryUserTalksService centerQueryUserTalksService;
    @Resource
    CenterQueryHomeTalksService centerQueryHomeTalksService;
    @Resource
    CenterPostTalkService centerPostTalkService;
    @Resource
    CenterTalkDeleteService centerTalkDeleteService;
    @Resource
    CenterTalkDetailService centerTalkDetailService;


    public List<SocialTalkRO> queryTalks(SocialHomeTalkQueryQO queryVO) {
        return centerQueryHomeTalksService.queryHomeTalks(queryVO);
    }

    public List<SocialTalkRO> queryUserTalks(SocialUserTalkQueryQO queryVO) {
        return centerQueryUserTalksService.queryUserTalks(queryVO);
    }

    public void addTalk(SocialTalkAddQO talkVO) {
        centerPostTalkService.addTalk(talkVO);
    }

    public void deleteTalk(SocialTalkDeleteQO talkVO) {
        centerTalkDeleteService.deleteTalk(talkVO);
    }

    public ResultRO<SocialTalkRO> queryTalkDetail(TalkIdQO talkIdQO) {
        return centerTalkDetailService.queryTalkDetail(talkIdQO.getTalkId());
    }
}
